package com.wangshouyu.mp.template;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.annotations.SerializedName;
import com.wangshouyu.mp.base.response.BaseResponse;

import java.util.Objects;

/**
 * @author 王守钰
 * @date 2020年12月19日 06:59
 * @description 模板消息发送结果
 */
public class TemplateMessageSendResult extends BaseResponse {

    /***
     * 消息id
     */
    @SerializedName(value = "msgid")
    @JsonProperty(value = "msgid")
    @JSONField(name = "msgid")
    private String msgId;

    public String getMsgId() {
        return msgId;
    }

    public void setMsgId(String msgId) {
        this.msgId = msgId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        TemplateMessageSendResult that = (TemplateMessageSendResult) o;
        return Objects.equals(msgId, that.msgId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), msgId);
    }

    public TemplateMessageSendResult(String msgId) {
        this.msgId = msgId;
    }

    public TemplateMessageSendResult() {
    }

    @Override
    public String toString() {
        return "TemplateMessageSendResult{" +
                "msgId='" + msgId + '\'' +
                '}';
    }
}
